﻿/*
 * 文件名称：
 * 程序员：wangyun
 * 创建时间：2008/06/16
 * 
 * 功能说明：单页信息模块
 * 
 * 修改人员：
 * 
 * 修改日期：
 * 
 * 修改记录：
 */

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Whir.Common.WebHelper;
using System.Collections.Specialized;
using System.Text.RegularExpressions;

public partial class Whir_System_Module_Contents_ContentManage : System.Web.UI.Page
{
    protected int TypeID, ModelID, ModelFormID;
    protected string Where;

    protected void Page_Load(object sender, EventArgs e)
    {
        RoleHelper.IsLogin();    //登录判断

        ModelID = NetRequest.GetQueryInt("ModelID");
        ModelFormID = NetRequest.GetQueryInt("ModelFormID");
        TypeID = NetRequest.GetQueryInt("TypeID");

        this.CommonContentManage1.CommonContentManage_RowCommand += new UserControls_ContentControl_CommonContentManage.RowCommand(CommonContentManage1_CommonContentManage_RowCommand);

        if (!IsPostBack)
        {
            if (TypeID != 0)
            {
                //初始化搜索条件
                ContentSearch1.ModelFormID = ModelFormID;
                ContentSearch1.TypeID = TypeID;

                //初始化内容管理条件
                Where = " TypeID =" + TypeID;
                CommonContentManage1.ModelID = ModelID;
                CommonContentManage1.ModelFormID = ModelFormID;
                CommonContentManage1.TypeID = TypeID;
                CommonContentManage1.Where = Where;
                CommonContentManage1.Settings = "1,show,应聘信息,查看,ShowItem";
            }
        }
    }

    void CommonContentManage1_CommonContentManage_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int rowID = Convert.ToInt32(e.CommandArgument);
        GridViewRow selectedRow = this.CommonContentManage1.GridView.Rows[rowID];
        string itemID = this.CommonContentManage1.GridView.DataKeys[rowID].Value.ToString();
        if (e.CommandName == "ShowItem")
        {
            Response.Redirect("JobRequestList.aspx?" + "&TypeID=" + TypeID + "&ItemID=" + itemID + "&url=" + Server.UrlEncode(NetRequest.GetUrl()));
        }
    }
}